<template>
  <div>
    <el-button type="primary" @click="getorder('111')">Primary</el-button>
    <el-button plain @click="open1"> Closes automatically </el-button>
    <el-tree-select v-model="value" :data="data" :render-after-expand="false" />
    <el-popconfirm title="Are you sure to delete this?">
    <template #reference>
      <el-button>Delete</el-button>
    </template>
  </el-popconfirm>
  </div>
  <son :son="values" ref="sonRef"></son>
</template>

<script lang="ts" setup>
 import { h,reactive } from 'vue';
 import { ElNotification } from 'element-plus';
 import { getOrder } from '/@/api/test/testData';
 import son from './components/son.vue';
 const form = reactive({
  clientName: '',
  createTime: '',
  phone:'',
  pageSize:20,
  pageNo:1,
})
const sonRef=ref()
const open1 = () => {
  ElNotification({
    title: 'Title',
    message: h('i', { style: 'color: teal' }, 'This is a reminder'),
  })
}
const getorder= async(e)=>{
  sonRef.value.open(e)
 const res= await getOrder()
 console.log(res);
 
}
import { ref } from 'vue'
const values='1'
const value = ref()

const data = [
  {
    value: '1',
    label: 'Level one 1',
    children: [
      {
        value: '1-1',
        label: 'Level two 1-1',
        children: [
          {
            value: '1-1-1',
            label: 'Level three 1-1-1',
          },
        ],
      },
    ],
  },
  {
    value: '2',
    label: 'Level one 2',
    children: [
      {
        value: '2-1',
        label: 'Level two 2-1',
      },
      {
        value: '2-2',
        label: 'Level two 2-2',
        children: [
          {
            value: '2-2-1',
            label: 'Level three 2-2-1',
          },
        ],
      },
    ],
  },
  {
    value: '3',
    label: 'Level one 3',
    children: [
      {
        value: '3-1',
        label: 'Level two 3-1',
        children: [
          {
            value: '3-1-1',
            label: 'Level three 3-1-1',
          },
        ],
      },
      {
        value: '3-2',
        label: 'Level two 3-2',
        children: [
          {
            value: '3-2-1',
            label: 'Level three 3-2-1',
          },
        ],
      },
    ],
  },
]
</script>

<style lang="less" scoped>

</style>